@extends('www/zc-admin/layout')


@section('content')
<div style="margin:auto;">
    <div class="types-box">
        <div>
            <img src="/www/zc666/images/admin/add-btn.png" onclick="type.add_type()">
            <h4>新建众筹</h4>
        </div>
        @foreach($types as $type)
            <div >
                <a style="background-image:url('/{{$type->img}}')" href="/www/zhongchouAdmin/total_order?typeId={{$type->type_id}}"></a>
                <p ondblclick="type.edit_type({{$type->type_id}},'{{$type->type_name}}','/{{$type->img}}')">{{$type->type_name}}</p>
            </div>
        @endforeach
    </div>
    {{ $types->appends(['sort' => 'votes'])->links() }}
</div>


<div class="new-type-box hide">
    <div class="top"></div>
    <div class="middle">

        <form action="/www/zhongchouAdmin/add_type" method="post" enctype="multipart/form-data">

            <input type="hidden" name="typeId" value="0">
            {{csrf_field()}}
            <p class="title"> <span>创建众筹</span><img src="/www/zc666/images/admin/close.png" onclick="type.close_type_box()"></p>

            <div>
                <p><span>众筹标题</span><input type="text" name="typeName"></p>
                <p>
                    <span>众筹封面</span>
                    <img id="faceimg" src="/www/zc666/images/admin/add-btn.png" onclick="$('#inputFile').click();">
                    <input type="file"  name="typeFile" class="hide" id="inputFile" accept="image/png,image/jpg,image/gif,image/jpeg" onchange="show_upload_img('inputFile',function(info){$('#faceimg').attr('src',info.data);})">
                </p>
            </div>

            <img class="add-btn" src="/www/zc666/images/admin/create.png" onclick="$('form').submit();">
        </form>

    </div>
    <div class="bottom"></div>
</div>


@endsection
